package lecture09.student;

/*
* 创建实体类Student,有私有属性,姓名name、年龄age、学号num、班级classnum
* 并提供无参和初始化三个参数的改造方法,以及get和set方法,以及printInf()
* */


class Student {
    private String name;
    private int age;
    private String num;
    private String classnum;

    public Student() {
    }

    public Student(String name, int age, String num, String classnum) {
        this.name = name;
        this.age = age;
        this.num = num;
        this.classnum = classnum;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getClassnum() {
        return classnum;
    }

    public void setClassnum(String classnum) {
        this.classnum = classnum;
    }

    public void printInf() {
        System.out.println("姓名: " + name + " 年龄: " + age + " 学号: " + num + " 班级: " + classnum);
    }
}



public class StudentTest {
    public static void main(String[] args) {
        Student s1 = new Student("张三", 18, "888", "23信管2班");
        s1.printInf();
    }
}
